export const OPEN_ERROR_CODE_MAP = {
  400: `错误请求（请求无效或缺少参数）`,
  401: `凭据无效（会话已过期或密钥已禁用/无效）`,
  402: `帐户余额不足`,
  403: `该模型需要审核，输入已被标记`,
  408: `请求超时`,
  429: `正在限流中`,
  502: `模型已下线或上游响应异常`,
  503: `无可用模型`,
};

export const BASE_TYPE_LOGIN = 'login';
export const BASE_TYPE_REG = 'register';
export const BASE_TYPE_FORGET_PWD = 'forget-pwd';
export const UPDATE_TYPE_PHONE = 'u-phone';
export const UPDATE_TYPE_EMAIL = 'u-email';
export const UPDATE_TYPE_PWD = 'u-pwd';
export const VERIFIED_UPDATE_TYPE_PHONE = 'vu-phone';
export const VERIFIED_UPDATE_TYPE_EMAIL = 'vu-email';
export const VERIFIED_UPDATE_TYPE_PWD = 'vu-pwd';
export const BIND_TYPE_PHONE = 'b-phone';
export const BIND_TYPE_EMAIL = 'b-email';
export const UNBIND_TYPE_PHONE = 'ub-phone';
export const UNBIND_TYPE_EMAIL = 'ub-email';
export const BASE_TYPE = [
  BASE_TYPE_LOGIN,
  BASE_TYPE_REG,
  BASE_TYPE_FORGET_PWD,
];
export const UPDATE_TYPE = [UPDATE_TYPE_PHONE, UPDATE_TYPE_EMAIL, UPDATE_TYPE_PWD];
export const VERIFIED_UPDATE_TYPE = [
  VERIFIED_UPDATE_TYPE_PHONE,
  VERIFIED_UPDATE_TYPE_EMAIL,
  VERIFIED_UPDATE_TYPE_PWD,
];
export const BIND_TYPE = [BIND_TYPE_PHONE, BIND_TYPE_EMAIL];
export const UNBIND_TYPE = [UNBIND_TYPE_PHONE, UNBIND_TYPE_EMAIL];
export const SMS_TYPE = [
  ...BASE_TYPE,
  ...UPDATE_TYPE,
  ...VERIFIED_UPDATE_TYPE,
  ...BIND_TYPE,
  ...UNBIND_TYPE,
];

export const IDENTITY_PHONE = 'phone';
export const IDENTITY_EMAIL = 'email';
export const IDENTITY = [IDENTITY_PHONE, IDENTITY_EMAIL];

export const IDENTITY_MAP = {
  [VERIFIED_UPDATE_TYPE_PHONE]: UPDATE_TYPE_PHONE,
  [VERIFIED_UPDATE_TYPE_EMAIL]: UPDATE_TYPE_EMAIL,
  [VERIFIED_UPDATE_TYPE_PWD]: UPDATE_TYPE_PWD,
};